package com.demo0215.feign;

import com.demo0215.entity.User;
import com.demo0215.entity.UserVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "user") //服务提供者在配置中心的名字  只到达端口2927：
public interface UserFeign {
    @GetMapping("/user/findAll/{index}/{limit}")
    UserVo findAll(@PathVariable("index") int index, @PathVariable("limit") int limit);

    @DeleteMapping("/user/deleteById/{id}")
    void deleteById(@PathVariable("id") long id);

    @PostMapping("/user/save")
    void save(User user);
    @PutMapping("/user/update")
    void update(User user);

    @GetMapping("/user/findById/{id}")
    User findById(@PathVariable("id") long id);

    @PostMapping("/user/count")
    int count();
}
